/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Hnmtuan
 */
@Entity
@Table(name = "employee")
@NamedQueries({
    @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e"),
    @NamedQuery(name = "Employee.findByIdEmp", query = "SELECT e FROM Employee e WHERE e.idEmp = :idEmp"),
    @NamedQuery(name = "Employee.findByEmpName", query = "SELECT e FROM Employee e WHERE e.empName = :empName"),
    @NamedQuery(name = "Employee.findByEmpPassword", query = "SELECT e FROM Employee e WHERE e.empPassword = :empPassword"),
    @NamedQuery(name = "Employee.findByEmpFName", query = "SELECT e FROM Employee e WHERE e.empFName = :empFName"),
    @NamedQuery(name = "Employee.findByEmpState", query = "SELECT e FROM Employee e WHERE e.empState = :empState")})
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idEmp")
    private String idEmp;
    @Column(name = "EmpName")
    private String empName;
    @Column(name = "EmpPassword")
    private String empPassword;
    @Column(name = "EmpFName")
    private String empFName;
    @Column(name = "EmpState")
    private Integer empState;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "employee")
    private List<EmployeeLogs> employeeLogsList;

    public Employee() {
    }

    public Employee(String idEmp) {
        this.idEmp = idEmp;
    }

    public String getIdEmp() {
        return idEmp;
    }

    public void setIdEmp(String idEmp) {
        this.idEmp = idEmp;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public String getEmpPassword() {
        return empPassword;
    }

    public void setEmpPassword(String empPassword) {
        this.empPassword = empPassword;
    }

    public String getEmpFName() {
        return empFName;
    }

    public void setEmpFName(String empFName) {
        this.empFName = empFName;
    }

    public Integer getEmpState() {
        return empState;
    }

    public void setEmpState(Integer empState) {
        this.empState = empState;
    }

    public List<EmployeeLogs> getEmployeeLogsList() {
        return employeeLogsList;
    }

    public void setEmployeeLogsList(List<EmployeeLogs> employeeLogsList) {
        this.employeeLogsList = employeeLogsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEmp != null ? idEmp.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employee)) {
            return false;
        }
        Employee other = (Employee) object;
        if ((this.idEmp == null && other.idEmp != null) || (this.idEmp != null && !this.idEmp.equals(other.idEmp))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.Employee[idEmp=" + idEmp + "]";
    }

}
